	public function executeShow(sfWebRequest $request)
	{
		$this-><?php echo $this->getSingularName() ?> = $this->getObject();

<?php if ($this->table->hasTemplate('Auditable')): ?>
		$this->show_audit = $this->getUser()->hasCredential(sfConfig::get('audit_credential'));
<?php else: ?>
		$this->show_audit = false;
<?php endif ?>

<?php if ($this->table->hasRelation('Anexo')): ?>
		$this->anexos = AnexoTable::getInstance()->getAnexoDetalles($this-><?php echo $this->getSingularName() ?>->anexo_id);
<?php endif ?>
	}

	private function getObject()
	{
		$q = $this->buildObjectQuery();
<?php if ($this->table->hasRelation('Carrera')): ?>
		CarreraUsuarioTable::addUserAccessQuery($q, 'a');
<?php endif ?>
		$object = $q->fetchOne();
		if (!$object)
			$this->forward('login','secure');

		return $object;
	}

	private function buildObjectQuery()
	{
		$parameters = $this->getRoute()->getParameters();
		$table = Doctrine_Core::getTable('<?php echo $this->modelClass ?>');

		$q = $table->createQuery('a');

		foreach ($parameters as $name => $value)
		{
			if (0 === strpos($name, 'sf_') || 'module' === $name || 'action' === $name)
			{
				continue;
			}

			if ($table->hasColumn($name))
			{
				$fieldName = $table->getFieldName($name);
				$q->andWhere('a.'. $fieldName . ' = ?', $parameters[$name]);
			}
		}

		return $q;
	}